<template>
  <div class="hello" style="width=Width;height=Height;">
    
    <loading :fullscreenLoading="fullscreenLoading"></loading>

    <el-container>
      <el-header style="height:10vh"><tabbar :tabactiv="1"></tabbar></el-header>
     
      <el-main>
        <div class="block" :style="'height:'+mainHight+'vh ;'">
          <el-carousel trigger="click" :height="handHight+'vh'">
            <el-carousel-item v-for="item in itemr1" :key="item.id">
              <img alt="" :src="item.url" class="imggg hand_img">
            </el-carousel-item>
          </el-carousel>
        </div>
        <div class="gonggao">
          <div class="gongleft">
            报考公告
          </div>
          <div class="gongright">
            2022山东招生计划已更新发布
          </div>
        </div>
        
        <div class="gongneng">
          <div class="biaotibox">
            <h2 class="hh2"></h2>
            <h2 class="hh3">常用工具</h2>
          </div>
          <div class="gjbox">
            <!-- <div class="gong1">
              <div class="gimg">
                <img src="../assets/gong1.png" alt="">
              </div>
              <div class="gongwenzi">智能匹配</div>
            </div> -->
            <!-- <div class="gong1">
              <div class="gimg">
                <img src="../assets/gong2.png" alt="">
              </div>
              <div class="gongwenzi">录取概率</div>
            </div> -->
            <div class="gong1">
              <div class="gimg" >
                <img src="../assets/gong3.png" @click="$router.replace('/moni')" alt="">
              </div>
              <div class="gongwenzi" >模拟填报</div>
            </div>
            <div class="gong1">
              <div class="gimg" @click="$router.replace('/zhuanjia')">
                <img src="../assets/gong4.png" alt="">
              </div>
              <div class="gongwenzi" >院校大全</div>
            </div>
            <div class="gong1">
              <div class="gimg">
                <img src="../assets/gong5.png" @click="$router.replace('/zhuanye')" alt="">
              </div>
              <div class="gongwenzi">专业宝典</div>
            </div>
            <div class="gong1" @click="open2()">
              <div class="gimg" >
                <img src="../assets/gong6.png"  alt="">
              </div>
              <div class="gongwenzi" >职业百科</div>
            </div>
            <div class="gong1" v-show="zhuangtai==1">
              <div class="gimg" @click="$router.replace('/zhuanjia')">
                <img src="../assets/gong7.png"  alt="">
              </div>
              <div class="gongwenzi">省控线</div>
            </div>
            <!-- <div class="gong1" @click="open2()">
              <div class="gimg">
                <img src="../assets/gong8.png" alt="">
              </div>
              <div class="gongwenzi">查分数线</div>
            </div> -->
            <!-- 全体本段人数 -->
            <div class="gong1"  v-show="zhuangtai==1">
              <div class="gimg">
                <img src="../assets/gong9.png" @click="$router.replace('/openpice')" alt="">
              </div>
              <div class="gongwenzi">一分一段表</div>
            </div>
            <div class="gong1" @click="$router.replace('/openpice')"  v-show="zhuangtai==1">
              <div class="gimg">
                <img src="../assets/gong10.png" alt="">
              </div>
              <div class="gongwenzi">招生计划</div>
            </div>
            <div class="gong1"  v-show="zhuangtai==1">
              <div class="gimg" @click="$router.replace('/zhuanjia')">
                <img src="../assets/gong11.png" alt="">
              </div>
              <div class="gongwenzi">大学排名</div>
            </div>
            <!-- <div class="gong1">
              <div class="gimg">
                <img src="../assets/gong12.png" alt="">
              </div>
              <div class="gongwenzi">院校对比</div>
            </div> -->
          </div>
          <!-- <div class="gimg">
            <img src="../assets/gong1.png" alt="">
          </div> -->
          <!-- <div class="gongwenzi"></div> -->
        </div>
        <div class="fengguang">
          <scenery></scenery>
        </div>
      </el-main>
      <el-footer>
        <P>备案号：开发人员：</P>
      
      </el-footer>
    </el-container>
  </div>
</template>
<style scoped>
@import "../style/index.css";

.frame{
  width: 265px;
  height: 180px;
  overflow: hidden; 
}
@media screen and (width:1000px) {
  .scenery{
    margin-top: 500px;

  }
  .biaotibox{
    line-height: 40px;
  }
  .gongleft{
    font-size:10px
  }
}
/* 
.yimg{width: 265px;
        height: 180px;
            cursor: pointer;
            transition: 0.45s;
            padding: auto;
          }
          .yimg:hover{
            border-radius: 10px;
            transform:scale(1.1);
          } 

     .wenzijieshao{
        width: 265px;
        height: 50px;
        line-height: 50px;
        font-size: 22px;
      } 
 .yimg{
  
}

  .yimg:hover{
    width: 120%;
    height: 100%;
    transition: width 1s, height 1s;
  } */
</style>
<script>
import Vue from "vue";

import Fcee_url from "../js/fceeConfig"
import loading from "./fceecomponents/loading.vue"
// const url = "http://110.42.188.221:8989";
Vue.prototype.$Fcee_url = Fcee_url//引入全局变量地址
import tabbar from "./fceecomponents/uitabbar.vue";
import scenery from "./fceecomponents/scenery.vue";
import axios from 'axios';
import { Tree } from "element-ui";
import tool from "./tool/tool";
// import oneps from "./fceecomponents/openpice.vue"
export default {

  components:{
    tabbar,
    scenery,
    loading,
    // oneps
  },
  name: "index",
  data() {
    return {
      Height:'',
      Width:"",
      itemr1:'',
      zhuangtai:1,
      Avatar:"http://110.42.188.221:8989/profile/avatar/2022/09/04/blob_20220904233610A020.png",
      schoolscenery:true,
      screenWith:0,
      handHight:40,//轮播图高度
      mainHight:40,//头部背景高度
      fullscreenLoading:true,
      zhuangtai:1
    };

  },
  methods: {
    open2() {
        this.$message({
          showClose: true,
          message: '此功能开发中',
          type: 'success'
        });
      },
    gohome(){
      this.$router.replace("/");
    }
    ,
    tiaotiao() {
      this.$router.replace("/yonghu");
    },
    getone() {
      this.$router.replace("/moni");
    },
    gettwo() {
      this.$router.replace("/zhuanjia");
    },
    getthree() {
      this.$router.replace("/zhuanye");
    },
   

    // showSchoolImg:function(index){
    //   if(this.screenWith<1000){
    //     if(this.screenWith<1000&&index==5){
    //       return true
    //     }
    //     if((this.screenWith>750&&this.screenWith<1000)&&(index==1||index==2)){
    //       return true
    //     }
    //   }
    //   else{
    //     return true
    //   }
    // },
    info:function(){
      console.log("执行")
  tool.$request("GET","/userInfo").then(res=>{
    console.log(res.data)
    this.Avatar = this.$Fcee_url.url+ res.data.Avatar
    console.log("头像地址"+this.UserInfo_url)
    this.UserName = res.data.username;
    console.log(this.UserName)

  })

    },
    setHandImag:function(){//动他调节轮播图高度
      console.log("设置轮播图")
      let that =this
      let width = tool.$getWindowWidth()
      console.log("hand获取宽度"+width)
      if(width<600){
        that.handHight=20
        console.log("轮播图高度为"+that.handHight)
        that.mainHight=20
      }
    },

    index1: function () {

      axios({
        method: 'GET',
        url:"/hphotos"
      }).then(response => {
        //  console.log(response.data.rows);
        this.itemr1 = response.data.rows;
        this.fullscreenLoading=false
      })
    },
    // index2: function () {

    //   axios({
    //     method: 'GET',
    //     url:"/CampusScenery/HomeCsp"
    //   }).then(response => {
    //     //  console.log(response.data.rows);

    //     this.itemr2 = response.data;
    //   })
    // },
   
    yangshi:function(){
      let ww=window.innerWidth;
      console.log(ww);
      this.screenWith = window.innerWidth
      if(ww<=1014){
        this.zhuangtai=0;


      }else{
        this.zhuangtai=1;
      }
    },
   
  },
  mounted(){
      window.onresize=()=>{
        this.yangshi();
      }
  }


  ,
  created() {
    this.index1();
    // console.log(this.itemr2);
    this.info();
  
    // this.yangshi();
    setTimeout( 
    this.setHandImag(),3000
    )

  },
  onload(){

  }
};
</script>
